<template>
  <view class="normal-login-container" :class="boole?'bottom115':''">
    <view class="item-wrap">
      <view class="lineBottom10">
        <uni-section title="撤销处置" type="line"/>
      </view>

      <view style="margin: 8rpx 20rpx 8rpx 20rpx">
        <uni-forms ref="ruleForm" :model="ruleForm" labelWidth="auto"
                   :label-position="boole ? 'top' : 'left'">
          <uni-forms-item label="说明:" name="specification" :required="boole"
                          :rules="[{required:true, errorMessage: '请输入说明',validateTrigger:'bind'}]">
            <text class="specification"/>
            <uni-easyinput type="textarea" v-if="boole" :maxlength="490" v-model="ruleForm.specification" placeholder="请输入说明"/>
            <text v-else>{{ ruleForm.specification || '-' }}</text>
          </uni-forms-item>
        </uni-forms>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'undoDisposal',
  props: {
    value: {
      type: Object,
      default: {},
    },
    boole: {
      type: Boolean,
      default: true,
    },
  },
  computed: {
    ruleForm: {
      get() {
        let that = this;
        const proxy = new Proxy(that.value, {
          get(target, key) {
            return Reflect.get(target, key);
          },
          set(target, key, value) {
            that.$emit("input", {...target, [key]: value});
            return true;
          },
        });
        return proxy;
      },
    },
    handleLabel() {
      return function (arr, type) {
        let name = "";
        arr.map((v) => {
          if (type == v.value) {
            name = v.label;
          }
        });
        return name;
      };
    },
  },
  watch: {},
  data() {
    return {};
  },
  created() {
  },
  mounted() {
  },
  methods: {
    handleEffect() {
      return new Promise((resolve, reject) => {
        this.$refs.ruleForm.validate().then((res) => {
          resolve();
        }).catch((err) => {
          let key = ".flex-col" + ">>>" + "." + err[0].key;
          reject(key);
        });
      });
    },
  },
};
</script>

<style scoped lang=""></style>


